package com.iarc.base.bugly

import com.tencent.bugly.crashreport.CrashReport

/**
 * author:kanlulu
 * data  :2021/9/3 12:41 下午
 **/
object BuglyUtils {

    fun reportCustomThrowable(throwable: Exception) {
        CrashReport.postCatchedException(throwable)
    }

    /**
     * app主动自动重启
     */
    fun reportRestartException() {
        val restartAppException = RestartAppAction("系统主动自动重启")
        CrashReport.postCatchedException(restartAppException)
    }

    /**
     * appANR重启
     */
    fun reportANRException() {
        val restartAppException = ANRRestartAppAction("ANR系统主动自动重启")
        CrashReport.postCatchedException(restartAppException)
    }

    /**
     * app未捕获异常重启
     */
    fun reportErrorRestartException() {
        val restartAppException = RestartAppAction("未捕获异常重启")
        CrashReport.postCatchedException(restartAppException)
    }

}